home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesU-Z.lzh / Vigilante.lha / VigilanteHd / Install next >
Text File  |  2001-10-09  |  4KB  |  196 lines

  1. ;****************************
  2.  
  3. (set #readme-file "ReadMe")             ;name of readme file
  4. (set #highs-file ("%s.save" @app-name))               ;name of high scores file
  5. (set #cleanup "")                       ;files to delete after install
  6. (set #last-file "disk.1")            ;last file the imager should create
  7.  
  8. ;****************************
  9. ;----------------------------
  10. ; checks if given program is installed, if not abort install
  11. ; #program - to check
  12.  
  13. (procedure P_ChkRun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort
  18.       (cat
  19.         "You must install \"" #program "\" first!\n"
  20.         "It must be accessible via the path.\n"
  21.         "You can find it in the WHDLoad package."
  22.       )
  23.     )
  24.   )
  25. )
  26.  
  27. ;****************************
  28.  
  29. (if
  30.   (exists #readme-file)
  31.   (if
  32.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  33.     ("")
  34.     (run ("SYS:Utilities/More %s" #readme-file))
  35.   )
  36. )
  37.  
  38. (set #program "WHDLoad")
  39. (P_ChkRun)
  40.  
  41. (set #program "RawDIC")
  42. (P_ChkRun)
  43.  
  44. (if
  45.   (= @user-level 2)
  46.   (
  47.     (set #CI_drive
  48.       (askchoice
  49.         (prompt "Select source drive for diskimages")
  50.         (default 0)
  51.         (choices "DF0:" "DF1:" "DF2:" "DF3:")
  52.         (help @askchoice-help)
  53.       )
  54.     )
  55.     (select #CI_drive
  56.       (set #CI_drive "DF0:")
  57.       (set #CI_drive "DF1:")
  58.       (set #CI_drive "DF2:")
  59.       (set #CI_drive "DF3:")
  60.     )
  61.     (set #ignore " IGNOREERRORS")
  62.   )
  63.   (set #CI_drive "DF0:")
  64.   (set #ignore "")
  65. )
  66.  
  67. (if
  68.   (getenv "WHDLInstPath")
  69.   (set @default-dest (getenv "WHDLInstPath"))
  70. )
  71. (set #dest
  72.   (askdir
  73.     (prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
  74.     (help @askdir-help)
  75.     (default @default-dest)
  76.     (disk)
  77.   )
  78. )
  79. (run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" @default-dest))
  80. (set #dest (tackon #dest @app-name))
  81. (if
  82.   (exists #dest)
  83.   (
  84.     (set #choice
  85.       (askbool
  86.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
  87.         (default 1)
  88.         (choices "Delete" "Skip")
  89.         (help @askbool-help)
  90.       )
  91.     )
  92.     (if
  93.       (= #choice 1)
  94.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  95.     )
  96.   )
  97. )
  98. (makedir #dest
  99.   (help @makedir-help)
  100.   (infos)
  101. )
  102.  
  103. ;----------------------------
  104.  
  105. (if
  106.   (exists ("%s.GlowIcon" @app-name))
  107.   (set #icon
  108.     (askchoice
  109.       (prompt "\nWhich icon would you like to install?\n")
  110.       (default 0)
  111.       (choices "Normal" "GlowIcon")
  112.       (help @askchoice-help)
  113.     )
  114.   )
  115.   (set #icon 0)
  116. )
  117. (select #icon
  118.   (set #icon ("%s.inf" @app-name))
  119.   (set #icon ("%s.GlowIcon" @app-name))
  120. )
  121. (copyfiles
  122.   (help @copyfiles-help)
  123.   (source #icon)
  124.   (newname ("%s.info" @app-name))
  125.   (dest #dest)
  126. )
  127. (tooltype
  128.   (dest (tackon #dest @app-name))
  129.   (settooltype "Slave")
  130.   (settooltype "PreLoad")
  131. )
  132. (tooltype
  133.   (dest (tackon #dest @app-name))
  134.   (settooltype "PreLoad" "")
  135.   (settooltype "Slave" ("%s.Slave" @app-name))
  136.   (setdefaulttool "WHDLoad")
  137.   (setstack 10240)
  138.   (noposition)
  139. )
  140. (copyfiles
  141.   (help @copyfiles-help)
  142.   (source ("%s.Slave" @app-name ))
  143.   (dest #dest)
  144. )
  145. (if
  146.   (exists #readme-file)
  147.   (copyfiles
  148.     (help @copyfiles-help)
  149.     (source #readme-file)
  150.     (dest #dest)
  151.   )
  152. )
  153. (if
  154.   (exists ("%s.info" #readme-file))
  155.   (
  156.     (copyfiles
  157.       (help @copyfiles-help)
  158.       (source ("%s.info" #readme-file))
  159.       (dest #dest)
  160.     )
  161.     (tooltype
  162.       (dest (tackon #dest #readme-file))
  163.       (noposition)
  164.     )
  165.   )
  166. )
  167. (if
  168.   (exists #highs-file)
  169.   (copyfiles
  170.     (help @copyfiles-help)
  171.     (source #highs-file)
  172.     (dest #dest)
  173.   )
  174. )
  175.  
  176. (copyfiles
  177.   (help @copyfiles-help)
  178.   (source ("%s.islave" @app-name))
  179.   (dest #dest)
  180. )
  181.  
  182. (working)
  183. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s%s\nDelete %s.islave" #dest @app-name #CI_drive #ignore @app-name))
  184.  
  185. (if
  186.   (exists (tackon #dest #last-file))
  187.   ("")
  188.   (abort "Diskimaging was not successful!\nRawDIC was unable to create all needed files!")
  189. )
  190.  
  191. ;----------------------------
  192.  
  193. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  194.  
  195. (exit)
  196.